﻿using System;
using System.Collections.Generic;
using System.Text;

namespace LdCms.BLL.Community
{
    using LdCms.EF.DbEntitiesContext;
    using LdCms.EF.DbModels;
    using LdCms.EF.DbStoredProcedure;
    using LdCms.IBLL.Community;
    using LdCms.IDAL.Community;
    using LdCms.Common.Json;
    using LdCms.Common.Security;
    using LdCms.Common.Extension;
    public partial class VThemeService:BaseService<V_Community_Theme>,IVThemeService
    {
        private readonly IVThemeDAL VThemeDAL;
        private readonly LdCmsDbEntitiesContext LdCmsDbEntitiesContext;
        public VThemeService(LdCmsDbEntitiesContext LdCmsDbEntitiesContext, IVThemeDAL VThemeDAL)
        {
            this.LdCmsDbEntitiesContext = LdCmsDbEntitiesContext;
            this.VThemeDAL = VThemeDAL;
            this.Dal = VThemeDAL;
        }
        public override void SetDal()
        {
            Dal = VThemeDAL;
        }

        public V_Community_Theme GetTheme(int systemId, string companyId, string themeId)
        {
            try
            {
                var expression = ExtLinq.True<V_Community_Theme>();
                expression = expression.And(m => m.SystemID == systemId && m.CompanyID == companyId && m.ThemeID == themeId);
                return Find(expression);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }


    }
}
